﻿<phone:PhoneApplicationPage xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Views="clr-namespace:Studio77.PopBall.Views"
    x:Class="Studio77.PopBall.Pages.GamePage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="ButtonStyleMagic" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFFFE800" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF8B0505" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFF33F3F" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.996" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF3E0000" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.161" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="10">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF0059C3" Offset="1"/>
                                        <GradientStop Color="#FF3F79F3"/>
                                        <GradientStop Color="#FF052A8B" Offset="0.148"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="StoryboardAddScore">
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border">
                <EasingColorKeyFrame KeyTime="0" Value="#9975FF00"/>
                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#990046FF">
                    <EasingColorKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#9975FF00">
                    <EasingColorKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseIn"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border">
                <EasingColorKeyFrame KeyTime="0" Value="#993B8100"/>
                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#99003B81">
                    <EasingColorKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#993B8106">
                    <EasingColorKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseIn"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border">
                <EasingColorKeyFrame KeyTime="0" Value="#9974FF00"/>
                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#99003AFF">
                    <EasingColorKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#9974FF00">
                    <EasingColorKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseIn"/>
                    </EasingColorKeyFrame.EasingFunction>
                </EasingColorKeyFrame>
            </ColorAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardShowScoreComment">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="txtSelectComment">
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:2.4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="txtSelectComment">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="txtSelectComment">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardShowGameCanvas">
            <DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="gameCanvas" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <ExponentialEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.5" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="gameCanvas" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <ExponentialEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Name="StoryboardHideGameCanvas">
            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="gameCanvas" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="-800" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="gameCanvas" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="StoryboardStageClear">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgStageClear">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounciness="3" Bounces="2"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgStageClear">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounciness="3" Bounces="2"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imgStageClear">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BounceEase EasingMode="EaseOut" Bounciness="3" Bounces="2"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardGameOver">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0" Value="480"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="0.5"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-480"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="ToggleButtonStyle1" TargetType="ToggleButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Yellow" Offset="0"/>
                                                            <GradientStop Color="#FFAEAE00" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/ball1.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                            <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42" Opacity="0" Stroke="Black" VerticalAlignment="Top" Width="40"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ToggleButtonStyle2" TargetType="ToggleButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Yellow" Offset="0"/>
                                                            <GradientStop Color="#FFAEAE00" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/ball2.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                            <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42" Opacity="0" Stroke="Black" VerticalAlignment="Top" Width="40"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ToggleButtonStyle3" TargetType="ToggleButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Yellow" Offset="0"/>
                                                            <GradientStop Color="#FFAEAE00" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/ball3.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                            <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42" Opacity="0" Stroke="Black" VerticalAlignment="Top" Width="40"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ToggleButtonStyle4" TargetType="ToggleButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Yellow" Offset="0"/>
                                                            <GradientStop Color="#FFAEAE00" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/ball4.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                            <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42" Opacity="0" Stroke="Black" VerticalAlignment="Top" Width="40"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
		<Storyboard x:Name="StoryboardShowPause">
        	<DoubleAnimation Duration="0:0:0.8" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="bdrPause" d:IsOptimized="True">
        		<DoubleAnimation.EasingFunction>
        			<CircleEase EasingMode="EaseInOut"/>
        		</DoubleAnimation.EasingFunction>
        	</DoubleAnimation>
        	<DoubleAnimation Duration="0:0:0.8" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="bdrPause" d:IsOptimized="True">
        		<DoubleAnimation.EasingFunction>
        			<CircleEase EasingMode="EaseInOut"/>
        		</DoubleAnimation.EasingFunction>
        	</DoubleAnimation>
        </Storyboard>
        <Storyboard x:Name="StoryboardHidePause">
        	<DoubleAnimation Duration="0:0:0.7" To="0.01" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="bdrPause" d:IsOptimized="True">
        		<DoubleAnimation.EasingFunction>
        			<CircleEase EasingMode="EaseInOut"/>
        		</DoubleAnimation.EasingFunction>
        	</DoubleAnimation>
        	<DoubleAnimation Duration="0:0:0.7" To="-481" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="bdrPause" d:IsOptimized="True">
        		<DoubleAnimation.EasingFunction>
        			<CircleEase EasingMode="EaseInOut"/>
        		</DoubleAnimation.EasingFunction>
        	</DoubleAnimation>
        </Storyboard>
        <Style x:Key="ToggleButtonStyle5" TargetType="ToggleButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Null}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Yellow" Offset="0"/>
                                                            <GradientStop Color="#FFAEAE00" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="3" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/ball5.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                            <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42" Opacity="0" Stroke="Black" VerticalAlignment="Top" Width="40"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleClose" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="#FF0051FF"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ColorAnimation Duration="0" To="#FFFFF300" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFFFF300" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FFFFF300" Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path1" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Ellipse x:Name="ellipse" Stroke="White" StrokeThickness="2">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFF6262" Offset="0"/>
                                        <GradientStop Color="#FF800202" Offset="1"/>
                                        <GradientStop Color="#FFAC0909" Offset="0.23"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Path x:Name="path" Data="M10,10 L24,24" HorizontalAlignment="Left" Height="16" Margin="9,9,0,0" Stretch="Fill" Stroke="White" StrokeThickness="4" UseLayoutRounding="False" VerticalAlignment="Top" Width="16">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFF6262" Offset="0"/>
                                        <GradientStop Color="#FF800202" Offset="1"/>
                                        <GradientStop Color="#FFAC0909" Offset="0.23"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Path x:Name="path1" Data="M10,10 L24,24" HorizontalAlignment="Left" Height="16" Margin="9,9,0,0" Stretch="Fill" Stroke="White" StrokeThickness="4" UseLayoutRounding="False" VerticalAlignment="Top" Width="16" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <CompositeTransform Rotation="90"/>
                                </Path.RenderTransform>
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFF6262" Offset="0"/>
                                        <GradientStop Color="#FF800202" Offset="1"/>
                                        <GradientStop Color="#FFAC0909" Offset="0.23"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="StoryboardShowMagicBall">
            <DoubleAnimation Duration="0:0:0.3" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrMagicBall" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <ExponentialEase EasingMode="EaseOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Name="StoryboardHideMagicBall">
            <DoubleAnimation Duration="0:0:0.3" To="-200" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrMagicBall" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <ExponentialEase EasingMode="EaseIn"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Name="StoryboardAddMagicBall">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stackPanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-7">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="0.3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="ButtonStyleSoundOff" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="/Images/sound_on.png" Stretch="Fill"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleSoundOn" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="/Images/sound_off.png" Stretch="Fill"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleHome" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Studio77.PopBall;component/Images/btn_home.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                                <Image.RenderTransform>
                                    <CompositeTransform/>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyle1" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<Grid.ColumnDefinitions>
        						<ColumnDefinition Width="53*"/>
        						<ColumnDefinition Width="194*"/>
        					</Grid.ColumnDefinitions>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ColorAnimation Duration="0" To="#FFFFDFA6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FFFF8B00" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FF442A04" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="MouseOver"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="FocusStates">
        							<VisualState x:Name="Focused"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="10" Grid.ColumnSpan="2">
        						<Border.Background>
        							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        								<GradientStop Color="#FF68FF00" Offset="0.07"/>
        								<GradientStop Color="#FF044421" Offset="1"/>
        								<GradientStop Color="#FFDCFFDD"/>
        							</LinearGradientBrush>
        						</Border.Background>
        					</Border>
        					<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1"/>
        					<Image x:Name="image" Margin="10,9,6.667,8" Source="/Images/colorball.png" Stretch="Fill"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Style x:Key="ButtonStyle3" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<Grid.ColumnDefinitions>
        						<ColumnDefinition Width="53*"/>
        						<ColumnDefinition Width="194*"/>
        					</Grid.ColumnDefinitions>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ColorAnimation Duration="0" To="#FFFFDFA6" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FFFF8B00" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FF442A04" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="MouseOver"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="FocusStates">
        							<VisualState x:Name="Focused"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="10" Grid.ColumnSpan="2">
        						<Border.Background>
        							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        								<GradientStop Color="Red" Offset="0.07"/>
        								<GradientStop Color="#FF440404" Offset="1"/>
        								<GradientStop Color="#FFFF8585"/>
        							</LinearGradientBrush>
        						</Border.Background>
        					</Border>
        					<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1"/>
        					<Image x:Name="image" Margin="10,9,6.667,8" Source="/Images/colorball.png" Stretch="Fill"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Viewbox>
        <Grid x:Name="LayoutRoot" Background="Transparent" Height="800" Width="480">
            <Grid.RowDefinitions>
                <RowDefinition Height="83*"/>
                <RowDefinition Height="277*"/>
                <RowDefinition Height="80"/>
            </Grid.RowDefinitions>

            <Image Grid.RowSpan="3" Source="/Images/gamebg.png" Stretch="Fill"/>
            <Border BorderThickness="1" HorizontalAlignment="Left" Height="166" VerticalAlignment="Top" Width="480" Background="#4C000000">
                <TextBlock x:Name="txtSelectComment" HorizontalAlignment="Center" Margin="0,0,0,1" TextWrapping="Wrap" Text="3  BALLS  45  POINTS" VerticalAlignment="Bottom" Opacity="0" RenderTransformOrigin="0.5,0.5" Foreground="White">
                    <TextBlock.RenderTransform>
                        <CompositeTransform/>
                    </TextBlock.RenderTransform>
                </TextBlock>
            </Border>

            <Views:GameCanvas x:Name="gameCanvas" HorizontalAlignment="Left" Height="520" Margin="0" VerticalAlignment="Center" Width="480" Background="#02000000" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Opacity="0">
                <Views:GameCanvas.RenderTransform>
                    <CompositeTransform TranslateY="-800"/>
                </Views:GameCanvas.RenderTransform>
            </Views:GameCanvas>
            <Border BorderBrush="#7FFFFFFF" BorderThickness="1" HorizontalAlignment="Left" Height="38" Margin="8,4,0,0" VerticalAlignment="Top" Width="357" Background="#33FFFFFF" CornerRadius="10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="26*"/>
                        <ColumnDefinition Width="45*"/>
                    </Grid.ColumnDefinitions>
                    <Border BorderThickness="1" HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="131" CornerRadius="10,0,0,10" Grid.ColumnSpan="2" Background="#7F000000">
                        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="TOP SCORE" VerticalAlignment="Center" Foreground="White"/>
                    </Border>
                    <TextBlock x:Name="txtHighScore" Grid.Column="1" HorizontalAlignment="Center" TextWrapping="Wrap" Text="0" VerticalAlignment="Center" Foreground="#FFFF3C3C" FontSize="24" Margin="0" FontFamily="Segoe WP Semibold"/>
                </Grid>
            </Border>
            <Border BorderBrush="#7FFFFFFF" BorderThickness="1" HorizontalAlignment="Left" Height="38" Margin="8,47,0,0" VerticalAlignment="Top" Width="357" Background="#33FFFFFF" CornerRadius="10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="79*"/>
                        <ColumnDefinition Width="65*"/>
                        <ColumnDefinition Width="87*"/>
                        <ColumnDefinition Width="124*"/>
                    </Grid.ColumnDefinitions>
                    <Border BorderThickness="1" HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="79" CornerRadius="10,0,0,10" Background="#7F000000">
                        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="STAGE" VerticalAlignment="Center" Foreground="White"/>
                    </Border>
                    <TextBlock x:Name="txtStage" Grid.Column="1" HorizontalAlignment="Center" TextWrapping="Wrap" Text="1" VerticalAlignment="Center" Foreground="#FFFFF300" FontSize="24" FontFamily="Segoe WP Semibold"/>
                    <Border BorderThickness="1" Grid.Column="2" HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="88" Background="#7F000000" Grid.ColumnSpan="2">
                        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="TARGET" VerticalAlignment="Center" Foreground="White"/>
                    </Border>
                    <TextBlock x:Name="txtTarget" Grid.Column="3" HorizontalAlignment="Center" TextWrapping="Wrap" Text="0" VerticalAlignment="Center" Foreground="#FFFFF300" FontSize="24" FontFamily="Segoe WP Semibold"/>
                </Grid>
            </Border>
            <Button Click="btnHome_Click" x:Name="btnHome" Content="Button" HorizontalAlignment="Left" Height="34" Margin="10,96,0,0" Style="{StaticResource ButtonStyleHome}" VerticalAlignment="Top" Width="35"/>
            <Button x:Name="btnMagicBall" Content="Magic Ball" HorizontalAlignment="Left" Height="39" Margin="382,46,0,0" Style="{StaticResource ButtonStyleMagic}" VerticalAlignment="Top" Width="88" FontSize="16" Click="btnMagicBall_Click" Foreground="White"/>
            <Button x:Name="btnSoundOff" Click="btnSoundOff_Click" Content="Button" Margin="55,88,377,30" Style="{StaticResource ButtonStyleSoundOff}"/>
            <Button x:Name="btnSoundOn" Click="btnSoundOn_Click" Content="Button" Margin="55,88,377,30" Style="{StaticResource ButtonStyleSoundOn}"/>
            <Border x:Name="border" BorderBrush="#4CFFFFFF" BorderThickness="1" HorizontalAlignment="Center" Height="40" Margin="111,93,111,0" VerticalAlignment="Top" Width="258" CornerRadius="20">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#993B8100" Offset="0.004"/>
                        <GradientStop Color="#9974FF00" Offset="1"/>
                        <GradientStop Color="#9974FF00" Offset="0.596"/>
                    </LinearGradientBrush>
                </Border.Background>
                <Grid>
                    <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding Text, ElementName=txtCurrentScore}" VerticalAlignment="Center" FontSize="32" FontFamily="Segoe WP Semibold" Foreground="White" RenderTransformOrigin="0.5,0.5">
                        <TextBlock.RenderTransform>
                            <CompositeTransform TranslateX="1" TranslateY="-1"/>
                        </TextBlock.RenderTransform>
                    </TextBlock>
                    <TextBlock x:Name="txtCurrentScore" HorizontalAlignment="Center" TextWrapping="Wrap" Text="0" VerticalAlignment="Center" FontSize="32" FontFamily="Segoe WP Semibold" RenderTransformOrigin="0.5,0.5">
                        <TextBlock.RenderTransform>
                            <CompositeTransform TranslateY="-2"/>
                        </TextBlock.RenderTransform>
                        <TextBlock.Foreground>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFFF1D3" Offset="0"/>
                                <GradientStop Color="#FFFFAE00" Offset="1"/>
                            </LinearGradientBrush>
                        </TextBlock.Foreground>
                    </TextBlock>
                </Grid>
            </Border>

            <Views:StageStartView x:Name="startView" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="480" Height="200" Margin="0,48,0,0" IsHitTestVisible="False" />
            <Image x:Name="imgStageClear" Grid.Row="1" Source="/Images/stageClear.png" Stretch="Fill" Width="375" Height="249" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-80,0,0" RenderTransformOrigin="0.5,0.5" Opacity="0" IsHitTestVisible="False" d:IsLocked="True">
                <Image.RenderTransform>
                    <CompositeTransform ScaleX="0" ScaleY="0"/>
                </Image.RenderTransform>
            </Image>
            <Image x:Name="imageStageClearFlag" Margin="373,92,6,7" Source="/Images/stageClear.png" Stretch="Fill" Visibility="Collapsed"/>
            <Image x:Name="image" Margin="51,131,50,334" Grid.Row="1" Source="/Images/gameover.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                <Image.RenderTransform>
                    <CompositeTransform TranslateX="480"/>
                </Image.RenderTransform>
            </Image>
            <Border x:Name="bdrMagicBall" BorderThickness="1,1,1,2" HorizontalAlignment="Left" Height="128" VerticalAlignment="Top" Width="480" CornerRadius="0,0,10,10" Background="#E5252525" RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <CompositeTransform TranslateY="-200"/>
                </Border.RenderTransform>
                <Border.BorderBrush>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="Black" Offset="0"/>
                        <GradientStop Color="White" Offset="1"/>
                        <GradientStop Color="#FF5D5D5D" Offset="0.878"/>
                    </LinearGradientBrush>
                </Border.BorderBrush>
                <Grid HorizontalAlignment="Center" Height="124" VerticalAlignment="Top" Width="467">
                    <Grid x:Name="gridTooltip1" Margin="0,0,171,74">
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Pick up a ball here to help you " VerticalAlignment="Top" Foreground="White"/>
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="replace any ball in the game area." VerticalAlignment="Top" Margin="0,23,0,0" Foreground="White"/>
                    </Grid>
                    <Grid x:Name="gridTooltip2" Margin="0,0,100,74" Visibility="Collapsed">
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Choose a ball in the game area to" VerticalAlignment="Top" Foreground="White"/>
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="make replace effect." VerticalAlignment="Top" Margin="0,23,0,0" Foreground="White"/>
                    </Grid>
                    <StackPanel HorizontalAlignment="Left" Height="69" Margin="10,55,0,0" VerticalAlignment="Top" Width="408" Orientation="Horizontal">
                        <ToggleButton x:Name="btnBall1" Click="btnBall1_Click_1" Content="ToggleButton" HorizontalAlignment="Center" Height="48" Style="{StaticResource ToggleButtonStyle1}" VerticalAlignment="Center" Width="48"/>
                        <ToggleButton x:Name="btnBall2" Click="btnBall1_Click_1" Content="ToggleButton" HorizontalAlignment="Center" Height="48" VerticalAlignment="Center" Width="48" Margin="40,0,0,0" Style="{StaticResource ToggleButtonStyle2}"/>
                        <ToggleButton x:Name="btnBall3" Click="btnBall1_Click_1" Content="ToggleButton" HorizontalAlignment="Center" Height="48" VerticalAlignment="Center" Width="48" Margin="40,0,0,0" Style="{StaticResource ToggleButtonStyle3}"/>
                        <ToggleButton x:Name="btnBall4" Click="btnBall1_Click_1" Content="ToggleButton" HorizontalAlignment="Center" Height="48" VerticalAlignment="Center" Width="48" Margin="40,0,0,0" Style="{StaticResource ToggleButtonStyle4}"/>
                        <ToggleButton x:Name="btnBall5" Click="btnBall1_Click_1" Content="ToggleButton" HorizontalAlignment="Center" Height="48" VerticalAlignment="Center" Width="48" Margin="40,0,0,0" Style="{StaticResource ToggleButtonStyle5}"/>
                    </StackPanel>
                    <Button x:Name="btnCloseToll" Content="Button" HorizontalAlignment="Left" Height="34" Margin="423,108,0,-18" Style="{StaticResource ButtonStyleClose}" VerticalAlignment="Top" Width="34" Click="btnCloseToll_Click"/>
                </Grid>
            </Border>
            <StackPanel x:Name="stackPanel" Margin="383,6,0,120" Orientation="Horizontal" RenderTransformOrigin="0.5,0.5">
                <StackPanel.RenderTransform>
                    <CompositeTransform/>
                </StackPanel.RenderTransform>
                <Image Source="/Images/colorball.png" Stretch="Fill" Width="34" Height="34" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,1"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="×" VerticalAlignment="Top" FontSize="26.667" Foreground="White" Margin="0"/>
                <TextBlock x:Name="txtMagicBallCount" HorizontalAlignment="Left" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" FontSize="26.667" Foreground="White" Margin="0" FontFamily="Segoe WP Semibold"/>

            </StackPanel>
            <Border BorderThickness="1" HorizontalAlignment="Left" Height="70" Grid.Row="2" VerticalAlignment="Bottom" Width="480" Background="#4C000000">
                <Image Source="/Images/logo77.png" Stretch="Fill" Width="120" Height="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Border>
            <UI:AdControl x:Name="adControl"
                          ApplicationId="dd94dee0-3bdd-44d0-bd25-528cd576d5eb" 
                          AdUnitId="120235" HorizontalAlignment="Left" Height="80" Grid.Row="2" VerticalAlignment="Top" Width="480" />
            <Border x:Name="bdrPause" BorderThickness="1" HorizontalAlignment="Left" Height="720" Grid.RowSpan="2" VerticalAlignment="Top" Width="480" Background="#99000000" RenderTransformOrigin="0.5,0.5" Opacity="0">
            	<Border.RenderTransform>
            		<CompositeTransform TranslateX="-480"/>
            	</Border.RenderTransform>
            	<Grid HorizontalAlignment="Left" Height="720" Margin="0,0,-2,-2" VerticalAlignment="Top" Width="480">
            		<Button x:Name="btnResume" Content="RESUME" HorizontalAlignment="Left" Height="53" Margin="117,315,0,0" VerticalAlignment="Top" Width="247" Style="{StaticResource ButtonStyle1}" Click="btnResume_Click"/>
            		<Button x:Name="btnMainMenu" Content="MAIN PAGE" Background="Black" Width="247" Style="{StaticResource ButtonStyle3}" BorderThickness="0" Margin="117,432,116,235" Height="53" Click="btnMainMenu_Click"/>
            	</Grid>
            </Border>
            <!--<mogo_WP7_sdk:AdsMogoView QuickMode="True" x:Name="adsMogo" AppID="5223c94ba27c402ab7eec77ff02b8e76" Grid.Row="2"/>-->

        </Grid>

    </Viewbox>

</phone:PhoneApplicationPage>